﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AgriculturalMachinery.Models
{
    public class PurchaseViewModel<T> : List<T>
    {
        /// <summary>
        /// 用户购买机具信息
        /// </summary>
        public IQueryable<Purchase> PurchaseInfo { get; private set; }

        /// <summary>
        /// 返回已注册用户
        /// </summary>
        public IQueryable QueryClient { get; private set; }

        /// <summary>
        /// 站内信
        /// </summary>
        public IQueryable<InnerSiteInfo> SiteMessage { get; private set; }

        public PurchaseViewModel(int id)
        {
            PurchaseRepository pr = new PurchaseRepository();
            PurchaseInfo = pr.GetPurchaseByID(id);

            AccountRepository ar = new AccountRepository();
            QueryClient = ar.FindAllClients();

            InnerSiteInfoRepository isr = new InnerSiteInfoRepository();
            SiteMessage = isr.GetInnerSiteInfoByID(id);
            
        }

    }
}
